//
//  CacheData.h
//  YueMi
//
//  Created by Rainbow on 4/27/11.
//  Copyright 2011 iTotemStudio. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Letter.h"
#import "Word.h"
#import "Message.h"
#import "Advertising.h" 

@interface CacheData : NSObject {
    NSArray *letters;
    HotWordViewType viewType;
    HotWordViewFrom viewFrom;
    Letter *selectedLetter;
    NSInteger currentLetterIndex;
    NSMutableArray *wrongWords;
    NSMutableDictionary *savedLetters;
    NSMutableArray *needUpdateLetters;
}

@property (nonatomic, retain) NSArray *letters;
@property (nonatomic, retain) Letter *selectedLetter;
@property (nonatomic, assign) HotWordViewType viewType;
@property (nonatomic, assign) HotWordViewFrom viewFrom;
@property (nonatomic, retain) NSMutableArray *wrongWords;
@property (nonatomic)  NSInteger currentLetterIndex;
@property (nonatomic, retain) NSMutableDictionary *savedLetters;
@property (nonatomic, retain) NSMutableArray *needUpdateLetters;

@property (nonatomic, retain) NSString *currentCategory;
@property (nonatomic, retain) Message *tempMessage;

@property (nonatomic, retain) NSArray *testYears;
@property (nonatomic, retain) Advertising *advertising;


+ (CacheData *)sharedData;

- (void)setCurrentCategory:(NSString *)currentCategory;

- (void) restore;

- (void) loadSelectedLetter:(NSInteger )letterIndex withFrom:(HotWordViewFrom)from;

- (BOOL) loadPerviousLetter;

- (BOOL) loadNextLetter;

- (Word *)getWordByPosition:(HotWordGetWordPosition)position;

- (Word *)getWordByIndex:(NSInteger)index;

- (void)syncLetterStatus;

- (void)addWrongWord:(Word *)word;

- (void)removeWrongWord:(Word *)word;

@end
